package com.liu.repository;

import com.liu.domain.teacher;
import org.codehaus.groovy.runtime.StringGroovyMethods;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

/**
 * Created by liu on 17-9-22.
 */
public interface TeacherRepository extends JpaRepository<teacher,String>{

    @Query("select t from teacher t where t.tea_id = ?1 and t.password = ?2")
    teacher login(String userName, String password);

    @Query("select s from teacher s where s.tea_id = ?1")
    public teacher findById(String tea_id);                   //通过id查

}
